Skip to content

Refactor value + unit renderings to use unified layout#3277

Merged
david-crespo merged 3 commits into
mainfrom
refactor_value_unit_rendering
Jul 14, 2026
Merged

Refactor value + unit renderings to use unified layout#3277
david-crespo merged 3 commits into
mainfrom
refactor_value_unit_rendering

Conversation

@charliepark

@charliepark charliepark commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

When I was working on #3214, I came across a number of occasions where we rendered a value and a unit, like 6 vCPUs or 128 GiB. We had a few different ways of rendering those. This PR creates a new component, <ValueUnit>, which renders the value, formatted, and the unit, also formatted. It also adds a <Size> component, built on top of <ValueUnit>.

Currently, the files changed in this branch do NOT step on the toes of main...standardize-unit-helpers, which is addressing some of the notes in https://gist.github.com/david-crespo/5fe725886475d18afa6cc459daf1acc3. Nevertheless, it might be best for that one to get wrapped up and merged first.

The screenshots aren't actually that exciting, because the goal here isn't really to change anything visually, but just to give context, look at the CPU / Memory columns:

Before:
Screenshot 2026-07-14 at 1 12 15 PM

After:
Screenshot 2026-07-14 at 1 11 58 PM

Closes #3276

@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
console Ready Ready Preview Jul 14, 2026 7:45pm

Request Review

<PropertiesTable.SizeRow
label="usable physical ram"
bytes={sled.usablePhysicalRam}
/>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. The unit label was too close before.

Image Image

@david-crespo david-crespo merged commit bea2497 into main Jul 14, 2026
7 checks passed
@david-crespo david-crespo deleted the refactor_value_unit_rendering branch July 14, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor to use existing sizeCellInner function more

2 participants